package com.xue.controller;

import com.xue.pojo.Result;
import com.xue.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/*
 * 信息统计接口
 * */
@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {

    @Autowired
    private ReportService reportService;

    /*
     * 获取各个职位员工的数量
     * */
    @GetMapping("/empJobData")
    public Result empJobData() {
        log.info("获取各个职位员工数量");
        return Result.success(reportService.empJobData());
    }

    /*
     * 获取员工性别数量
     * */
    @GetMapping("/empGenderData")
    public Result empGenderData() {
        log.info("获取员工性别数量");
        List<Map<String, Object>> list = reportService.empGenderData();
        return Result.success(list);
    }

}
